import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../pages/Home/Home.vue'
import Me from '../pages/Me/Me.vue'
import Recommend from '../pages/Recommend/Recommend.vue'
import Search from '../pages/Search/Search.vue'
import Chat from '../pages/Chat/Chat.vue'
// 热门
import Hot from '../pages/Home/Children/Hot/Hot.vue'
// 服饰
import Clothes from '../pages/Home/Children/Clothes.vue'
// 鞋包
import ShoeBag from '../pages/Home/Children/ShoeBag.vue'
// 母婴
import Infant from '../pages/Home/Children/Infant.vue'
// 百货
import Store from '../pages/Home/Children/Store.vue'
// 食品
import Food from '../pages/Home/Children/Food.vue'
// 内衣
import Underwear from '../pages/Home/Children/Underwear.vue'
// 男鞋
import ManShoes from '../pages/Home/Children/ManShoes.vue'
// 电器
import Electric from '../pages/Home/Children/Electric.vue'
// 登陆
import Login from '../pages/Me/children/Login.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/home', redirect: '/home/hot' },
      { path: 'hot', component: Hot },
      { path: 'clothes', component: Clothes },
      { path: 'shoeBag', component: ShoeBag },
      { path: 'infant', component: Infant },
      { path: 'store', component: Store },
      { path: 'food', component: Food },
      { path: 'underwear', component: Underwear },
      { path: 'manShoes', component: ManShoes },
      { path: 'electric', component: Electric }
    ]
  },
  {
    path: '/me',
    component: Me,
    meta: {
      isNav: true
    }
  },
  {
    path: '/login',
    component: Login,
    meta: {
      isNav: true
    }
  },
  { path: '/recommend', component: Recommend },
  { path: '/search', component: Search },
  { path: '/chat', component: Chat }
]

const router = new VueRouter({
  routes
})

export default router
